﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace WTwitter.ViewModel {
	public class ViewModelBase : INotifyPropertyChanged {
		public ViewModelBase(string displayName) {
			_displayName = displayName;
		}


		#region INotifyPropertyChanged メンバ

		public event PropertyChangedEventHandler PropertyChanged;

		#endregion

		protected void OnPropertyChanged(string propertyName) {
			var handler = PropertyChanged;
			if (handler != null) {
				handler(this, new PropertyChangedEventArgs(propertyName));
			}
		}

		public string DisplayName {
			get { return _displayName; }
			set {
				if (value != _displayName) {
					_displayName = value;
					OnPropertyChanged("DisplayName");
				}
			}
		}

		private string _displayName;
	}
}
